#ifndef LCD_H
#define LCD_H

#include "spi.h"
#include "gpio.h"
#include <stdint.h>

extern uint8_t font8x16[][16];

void lcd_init(SPI_HandleTypeDef* hspi, GPIO_TypeDef* port, uint16_t pin);
void lcd_clear(uint16_t color);
uint16_t lcd_color(uint8_t red, uint8_t green, uint8_t blue);
void lcd_drawstring(uint8_t x, uint8_t y, uint16_t fc, uint16_t bc, char* s);
void lcd_drawtext(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t fc, uint16_t bc, uint8_t* font);
void lcd_drawrect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t color);
void lcd_drawbitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t* bitmap);
void lcd_drawqrc(uint8_t x, uint8_t y, uint8_t version, uint8_t ecc, char* text, uint16_t fc, uint16_t bc);

#endif
